home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / bin / tackdown / tackdown.main.c < prev   
C/C++ Source or Header  |  1993-03-10  |  1KB  |  59 lines

  1. #include <stdio.h>
  2. #include "geom.h"
  3. #include "streampool.h"
  4. #include "forms.h"
  5. #include "panel.h"
  6.  
  7. static Pool *standardIn, *standardOut;
  8.  
  9. main() {
  10.  
  11.   foreground();
  12.  
  13.   standardIn = PoolStreamTemp(NULL, stdin, 0, NULL);
  14.   standardOut = PoolStreamTemp(NULL, stdout, 1, NULL);
  15.  
  16.   create_the_forms();
  17.   fl_set_button(worldButton, 1);
  18.   fl_show_form(MainForm, FL_PLACE_SIZE, TRUE, "Tack Down");
  19.   while(1) fl_do_forms();
  20.  
  21. }
  22.  
  23.  
  24. void TransButtonProc(FL_OBJECT *o, long val) {
  25.   char buf[256];
  26.   Geom *g;
  27.   Transform t;
  28.  
  29.   printf("(write geometry - targetgeom bare)");
  30.   printf("(write transform - targetgeom %s)", 
  31.      fl_get_button(worldButton) ? "world" : "universe");
  32.   fflush(stdout);
  33.   
  34.   g = GeomFLoad(stdin, NULL);
  35.  
  36.   TransStreamIn(standardIn, NULL, t);
  37.  
  38.   GeomTransform(g, t);
  39.  
  40.   printf("(freeze allcams)");
  41.   printf("(geometry targetgeom {");
  42.   GeomFSave(g, stdout, NULL);
  43.   printf("})");
  44.   printf("(xform-set targetgeom ");
  45.   fputtransform(stdout, 1, &TM_IDENTITY[0][0], 0);
  46.   printf(")");
  47.   printf("(redraw allcams)");
  48.   fflush(stdout);
  49.   fl_set_button(TransButton, 0);
  50.  
  51.   GeomDelete(g); 
  52.  
  53. }
  54.  
  55.  
  56. void QuitButtonProc(FL_OBJECT *o, long val) {
  57.   exit(0);
  58. }
  59.